		<p style="height: 5px;"></p>
			
			<div id="top" class="easyui-panel" title="测算信息" data-options="cls:'theme-panel-orange'" style="width:100%;height:190px;padding:10px;">
				<table border="0" style="width:100%;">
					<tr >
						<td  colspan="6" style="font-size: 15px;font-weight: bold;">到店访问:<span id="toshopvisitcount" style="color: red;">0</span>次，电话回访:<span id="callvisitcount"  style="color: red;">0</span>次</td>
					</tr>
					<tr>
						<td  style="width: 15%">
							姓名：<input class="easyui-combobox inputBox theme-textbox-radius" name="temporary.name"  id="tem_name" value="${temporary.name !}"  
							data-options="
							url:'measurement/getCusInfo',
							method:'post',
							valueField:'name',
							textField:'name'
							">
						</td>
						
						<td>
						手机：<input class="easyui-combobox inputBox theme-textbox-radius" name="temporary.phone"  id="tem_phone"   value="${temporary.phone !}"  
							data-options="
							url:'measurement/getCusInfo',
							method:'post',
							valueField:'phone',
							textField:'phone'
							">
								
						</td>
						
						<td>
							性别：<select id="tem_sex" name="temporary.sex" class="easyui-combobox inputBox theme-textbox-radius" panelHeight="auto" data-options="editable: false">
									<% if(temporary.sex! == '男'){ %>
										<option value="男" selected="selected">男</option>
									<% } %>
									 <% if(temporary.sex! == '女'){ %>
										<option value="女" selected="selected">女</option>
									<% } %>
									<% else{ %>
										<option value="女">女</option>
										<option value="男">男</option>
									<% } %>
							</select>
						</td>
						
					
						<td>
							年龄：<input id="tem_age" name="temporary.age" class="easyui-numberspinner inputBox theme-textbox-radius" value="${temporary.age !}" data-options="increment:1,min:1,max:100,label:'岁'" labelPosition="after"></input>
						<input id="ylc"  type = "hidden" value="${ylc !}">
						<input id="bzlc"   type = "hidden" value="${bzlc !}">
						</td>
						<td >
							身高：<input id="tem_height" name="temporary.height" class="easyui-numberspinner inputBox theme-textbox-radius" value="${temporary.height !}" data-options="increment:1,min:100,max:251,label:'cm'" labelPosition="after"></input>
						</td>
						<td style="width:20%">
							体重：<input id="tem_weight" name="temporary.weight" class="easyui-numberspinner inputBox theme-textbox-radius" value="${temporary.weight !}" data-options="increment:0.1,min:1,label:'斤',precision:1" labelPosition="after"></input>
							<a  class="easyui-linkbutton" data-options="" onclick="mesure()">测算</a>
						</td>
						
					</tr>
					
					
					
					<tr>
						<td >
							标准：<input id="stantardWeight" name="customerAgreement.std_weight"  class="easyui-textbox inputBox theme-textbox-radius" readonly="readonly"  data-options="label:'斤'" labelPosition="after" value="${temporaryAgreement.std_weight !}"> 
						</td>
						<td >
							目标：<input id="goalWeight" name="targetWeight" class="easyui-textbox inputBox theme-textbox-radius"   data-options="label:'斤',panelHeight:'0'" labelPosition="after" value="${temporaryDetail.delweight !}" >
						</td>
						<td >
							应减：<input id="loseWeight" name = "delWeight" class="easyui-textbox inputBox theme-textbox-radius" readonly="readonly"  data-options="label:'斤'" labelPosition="after" value="${temporaryDetail.delweight !}">
						</td>
						<td>
							周期：<input id="target_input"  name="customerAgreement.target"  class="easyui-numberspinner inputBox theme-textbox-radius"  data-options="increment:1,min:0,max:24,label:'月'" labelPosition="after" >
						</td>
						<td>
							疗程：<input id="lcNumber" name="customerAgreement.treatment"   readonly="readonly"  class="easyui-textbox inputBox theme-textbox-radius"  value="${temporaryAgreement.treatment !}">
						</td>
						<td>
							金额：<input id="amount"  name="customerAgreement.cost"  class="easyui-textbox inputBox theme-textbox-radius" readonly="readonly"  data-options="label:'元'" labelPosition="after" >
						</td>
					</tr>
					
					
					
					
				</table>
			</div>
			
			
			
			
			<p style="height: 5px;"></p>
			<div id="bottom" class="easyui-panel" title="接待登记" style="width:100%;height:auto;padding:10px;" data-options="cls:'theme-panel-orange'">
				<table border="0"  style="width:100%;">
					<tr>
						<td>
						接&nbsp;待&nbsp;人&nbsp;&nbsp;<#organization type="select" id="jdr_select" name="temporary.jdr"  defaultCode="${userids !}" class="easyui-combobox inputBox theme-textbox-radius" organization="${organids! }"/>
						</td>
						<td>
								顾客反映&nbsp;<#code type="select" id="gkfy_select" name="temporary.gkfy" code="code_gkfy" defaultCode="${temporary.gkfy! }"  class="easyui-combobox inputBox theme-textbox-radius" />
						</td>
						<td>
								进店方式&nbsp;<#code type="select" id="jdfs_select" name="temporary.jdfs" code="code_jdfs" defaultCode="${temporary.jdfs! }"  class="easyui-combobox inputBox theme-textbox-radius" />
						</td>
					
						<td id="jsrPhonetd"  style="width: 17%">
							介绍人手机&nbsp;<input class="easyui-combobox inputBox theme-textbox-radius" name="temporary.jsrPhone"  id="jsrPhone"   value="${temporary.phone !}"  
							data-options="
							url:'measurement/getCusAndUserInfo',
							method:'post',
							valueField:'phone',
							textField:'phone'
							">

						</td>
						<td id="jsrNametd" >
								 <input id="jsrIds" type="hidden" name="temporary.jsrIds" value="${temporary.jsrIds !}" >
								 <input id="jsrtype" type="hidden" name="temporary.jsrtype" value="${temporary.jsrtype !}" >
							介绍人&nbsp;<input id="jsrName"  name="temporary.jsrName"  class="easyui-textbox inputBox theme-textbox-radius" value="${temporary.name !}"  readonly="readonly">
						</td>
						<td   id="jsrStoreNametd" style="width: 17%">	
							介绍人门店&nbsp;<input id="jsrStoreName"   name="temporary.jsrStore"  class="easyui-textbox inputBox theme-textbox-radius"  value="${temporary.organization.name !}" readonly="readonly">
						</td>
					</tr>
					<tr>
					
						
						<td>
							顾客分类&nbsp;<#code type="select" id="gkfl_select" name="temporary.gkfl" code="code_gkfl" defaultCode="${temporary.gkfl! }"  class="easyui-combobox inputBox theme-textbox-radius" />
						</td>
						<td id="fzr_select">
							负&nbsp;责&nbsp;人&nbsp;&nbsp;<#organization type="select" id="cp_select" name="chargePersion" organization="${organids! }" defaultCode="${userids !}"   class="easyui-combobox inputBox theme-textbox-radius" />
						</td>
						<td id="wcjyy_td_select">
							原&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;因&nbsp;&nbsp;<#code type="select" id="wcjyy_select" name="temporary.loseReason" code="code_wcjyy" defaultCode="${temporary.loseReason! }"  class="easyui-combobox inputBox theme-textbox-radius" />
						</td>
						
						
					</tr>
					<tr>
					<td colspan="6">
						减肥目的&nbsp;<input id="talk" name="temporary.talk" class="easyui-textbox inputBox theme-textbox-radius"  style="width:504px;height: 50px" > 
					</td>
					</tr>
				</table>
			</div>
			
			
			
			
			<p style="height: 5px;"></p>
			<div id="ddfwbottom" class="easyui-panel" title="到店访问" style="width:100%;height:auto;padding:10px;" data-options="cls:'theme-panel-orange'"  closed="true"></div>
			
			<p style="height: 5px;"></p>
			<div id="dhhfbottom" class="easyui-panel" title="电话回访" style="width:100%;height:auto;padding:10px;" data-options="cls:'theme-panel-orange'"  closed="true"></div>
			
			<a  class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="save()" style="margin-left: 40%;margin-top: 20px;width:150px;height: 35px">保存</a>
				
	<script  type="text/javascript" charset="utf-8">

	$(document).ready(function () {
		$("#tem_name").combobox({
			onChange: function (n,o) {
				if(n.length>=2&&n.length<5){
					searchInfo(n,null)
				}
			}
		});
		$("#tem_phone").combobox({
			onChange: function (n,o) {
				if(n.length==11){
					searchInfo(null,n)
				}

			}
		});
		$("#jsrPhone").combobox({
			onChange: function (n,o) {
				if(n.length==11){
					selStore(n)
				}

			}
		});
		
	});
	
	
	
		
		function visitcall(ids){
			loadDialog($('#datagrid'),null, '回访', 'scallVisit/showscallVisit?ids='+ids,960,550);
		};
		
		
		
		function  searchInfo(name,phone){
			$('#dhhfbottom').panel('close'); 
			$('#ddfwbottom').panel('close'); 
			var url='/measurement/phoneSearch';
			var data={"phone":phone,"name":name};
			var reData = common_ajax.ajaxFunc(url,data,"json");
			if(reData.msg==200){
				
				//$("#customerIds").val(reData.ids);
				$("#callvisitcount").html(reData.callvisitcount);
				$("#toshopvisitcount").html(reData.toshopvisitcount);
				$("#tem_name").textbox('setValue',reData.name);
				$("#tem_sex").textbox('setValue',reData.sex);
				$("#tem_phone").textbox('setValue',reData.phone);
				$("#tem_age").textbox('setValue',reData.age);
				$("#tem_height").textbox('setValue',reData.height);
				$("#tem_weight").textbox('setValue',reData.weight);
				$("#loseWeight").textbox('setValue',reData.delWeight);
				$("#lcNumber").textbox('setValue',reData.treatment);
				$("#goalWeight").textbox('setValue',reData.targetWeight);
				$("#amount").textbox('setValue',reData.cost);
				$("#target_input").textbox('setValue',reData.weightDay);
				$("#stantardWeight").textbox('setValue',reData.standWeight);
				$("#jdr_select").combobox('setValue',reData.jdr);
				$("#gkfy_select").combobox('setValue',reData.gkfy);
				$("#jdfs_select").combobox('setValue',reData.jdfs);
				$("#wcjyy_select").combobox('setValue',reData.loseReason);
				
				$("#jsrName").textbox('setValue',reData.jsrName);
				$("#jsrPhone").textbox('setValue',reData.jsrPhone);
				$("#jsrStoreName").textbox('setValue',reData.jsrStore);
				$("#gkfl_select").combobox('setValue',reData.gkfl);
				//$("#cp_select").combobox('setValue',reData.gkfl); 
				
				if(reData.resultddfw!=null){
					$('#ddfwbottom').panel('open'); 
					var table ='<table id="mbtable2" border="1"  bordercolor="#DDDDDD" style="width:100%;height:85%; text-align: center;font-size: 15px;">'
						+'<tr style="width:100%;height: 40px;font-weight: bold;">'
						+'<td style="width:17%;height: 40px;">访问日期</td>'
						+'<td style="width:7%;height: 40px;">接待店员</td>'
						+'<td style="width:7%;height: 40px;">体重</td>'
						+'<td style="width:7%;height: 40px;">顾客反映</td>'
						+'<td style="width:7%;height: 40px;">顾客分类</td>'
						+'<td >谈话内容</td>'
						+'<td style="width:7%;height: 40px;">操作</td>'
						+'</tr>'
						+'</table>';
					$("#ddfwbottom").html(table);
				$.each(reData.resultddfw, function(index, content){ 
					
					var advice =content.advice;
				
					if(advice==null||advice=='null'){
						advice ='';
					}
				var	newRow='<tr style="width:100%;height: 40px;">'
						+'<td >'+content.visitdate.substring(0,10)+'</td>'
						+'<td >'+content.jdr+'</td>'
						+'<td >'+content.weight+'</td>'
						+'<td >'+content.issatisfaction+'</td>'
						+'<td >'+content.gkfl+'</td>'
						+'<td >'+
						advice
						+'</td>'
						+'<td ><a onclick='+'visitcall(\'' + reData.temporaryCustomerIds + '\')'+' class='+'button-edit button-success  l-btn l-btn-small'+'><span class='+'l-btn-left'+'><span  style='+'color:green'+' class='+'l-btn-text'+'>回访</span></span></a></td>'
						+'</tr>';
					$('#mbtable2').append(newRow); 
				});
					
					
				}
				
				if(reData.resultdhhw!=null){
					
					$('#dhhfbottom').panel('open'); 
					
					var table ='<table id="mbtable1" border="1"  bordercolor="#DDDDDD" style="width:100%;height:85%; text-align: center;font-size: 15px;">'
						+'<tr style="width:100%;height: 40px;font-weight: bold;">'
						+'<td style="width:17%;height: 40px;">回访日期</td>'
						+'<td style="width:7%;height: 40px;">回访店员</td>'
						+'<td style="width:7%;height: 40px;">顾客反映</td>'
						+'<td style="width:7%;height: 40px;">顾客分类</td>'
						+'<td >谈话内容</td>'
						+'</tr>'
						+'</table>';
					$("#dhhfbottom").html(table);
					$.each(reData.resultdhhw, function(index, content){ 
						var advice =content.advice;
	
						if(advice==null||advice=='null'){
							advice ='';
						}
						var	newRow='<tr style="width:100%;height: 40px;">'
								+'<td >'+content.visitdate.substring(0,10)+'</td>'
								+'<td >'+content.jdr+'</td>'
								+'<td >'+content.issatisfaction+'</td>'
								+'<td >'+content.gkfl+'</td>'
								+'<td >'+advice+'</td>'
								+'</tr>';
							$('#mbtable1').append(newRow); 
					 });
				}
			}else{
				 //$('#zxcsform').form('clear');
				//$("#tem_phone").textbox('setValue',phone);
				//$.alert(parent.$, reData.msg);
				//parent.window.nodeClick("咨询测算", "/measurement");
			}
			
			$('#todaymeasuretablefromcall').datagrid({
				queryParams: {
					'phone': phone,
				},
				singleSelect: true,
				//rownumbers: true, //显示序号
				pagination: true,
				fitColumns:true,
				pageSize: 10,
				url:'measurement/querypeoplefromcall',
				collapsible: true,
				columns:[[
// 			  		{field:'phone',title:'手机号',width:100,align:'center'},
			  		{field:'visitdate',title:'日期',width:91,align:'center'},
			  		{field:'jdr',title:'接待人',width:91,align:'center'},
			  		{field:'advice',title:'谈话内容',width:91,align:'center'},
			  		{field:'losereason',title:'未成交原因',width:91,align:'center'},
// 			  		{field:'xx',title:'操作',width:91,align:'center',
// 						formatter:function(value,row,index){
// 							return '<a onclick='+'btn1(\'' + row.phone + '\')'+' class='+'button-edit button-success  l-btn l-btn-small'+'><span class='+'l-btn-left'+'><span  style='+'color:red'+' class='+'l-btn-text'+'>回访</span></span></a>'
// 							+'<a onclick='+'btn2(\'' + row.phone + '\')'+' class='+'button-edit button-success  l-btn l-btn-small'+'><span class='+'l-btn-left'+'><span  style='+'color:green'+' class='+'l-btn-text'+'>查询</span></span></a>';
// 					}},
					]]
			});
			
			$('#todaymeasuretable').datagrid({
				queryParams: {
					'phone': phone,
				},
				singleSelect: true,
				//rownumbers: true, //显示序号
				pagination: true,
				
				pageSize: 10,
				url:'measurement/querypeople',
				collapsible: true,
				columns:[[
// 			  		{field:'phone',title:'手机号',width:100,align:'center'},
			  		{field:'visitdate',title:'日期',width:91,align:'center'},
			  		{field:'jdr',title:'接待人',width:91,align:'center'},
			  		{field:'advice',title:'谈话内容',width:91,align:'center'},
			  		{field:'losereason',title:'未成交原因',width:91,align:'center'},
// 			  		{field:'xx',title:'操作',width:91,align:'center',
// 						formatter:function(value,row,index){
// 							return '<a onclick='+'btn1(\'' + row.phone + '\')'+' class='+'button-edit button-success  l-btn l-btn-small'+'><span class='+'l-btn-left'+'><span  style='+'color:red'+' class='+'l-btn-text'+'>回访</span></span></a>'
// 							+'<a onclick='+'btn2(\'' + row.phone + '\')'+' class='+'button-edit button-success  l-btn l-btn-small'+'><span class='+'l-btn-left'+'><span  style='+'color:green'+' class='+'l-btn-text'+'>查询</span></span></a>';
// 					}},
					]]
			});	
			//mesure();
			return  reData; 
		}
		</script>		